#!/bin/bash
scriptWorkd=$(cd "$(dirname $0)";pwd)

### ========= 全局变量 ===========
### ==============================

### ========= 前置文件 ===========
if [[ -f ${HOME}/bin/basic_func.sh ]];then  ### 存在才载入
    source ${HOME}/bin/basic_func.sh
elif [[ -f ./bin/basic_func.sh ]];then
    source ./bin/basic_func.sh
elif [[ -f ../bin/basic_func.sh ]];then
    source ../bin/basic_func.sh
fi
### ==============================


function main() {
set -e

    sudo apt install --reinstall linux-headers-$(uname -r)
    
    mkdir -p ${HOME}/Downloads/legion-deb-19
    cd ${HOME}/Downloads/legion-deb-19
    
    wget -O legiond_0.0.19.deb http://ftp.cn.debian.org/debian/pool/main/l/lenovolegionlinux/legiond_0.0.19+git2025-02-20.43f2ad0e+ds-0.2_amd64.deb
    wget -O lenovolegionlinux-dkms.deb http://ftp.cn.debian.org/debian/pool/main/l/lenovolegionlinux/lenovolegionlinux-dkms_0.0.19+git2025-02-20.43f2ad0e+ds-0.2_amd64.deb
    wget -O python3-legion-linux_0.0.19.deb http://ftp.cn.debian.org/debian/pool/main/l/lenovolegionlinux/python3-legion-linux_0.0.19+git2025-02-20.43f2ad0e+ds-0.2_all.deb    
    # wget -O http://ftp.cn.debian.org/debian/pool/main/l/lenovolegionlinux/lenovolegionlinux-sound_0.0.19+git2025-02-20.43f2ad0e+ds-0.2_amd64.deb
    
    sudo apt install ./*

}
main $@
